Repository navigation
fix: Reuse the first page in autoPagination - #1748
Merged
Merged
Conversation
Every list method already makes the first request before handing the result to AutoPaginatable, but autoPagination() ignored that page and requested the list from the start again with limit=100. Every autoPagination() call therefore cost at least two round trips, even when the first response already held the whole list. Continuing from the first page's cursor drops the redundant request. Follow-up pages still walk forward from that page, which also makes the before-cursor special case from #1720 unnecessary. Fixes #1746
Contributor
[Medium impact] The PR appears safe to merge; no actionable issues were found. Summary
No actionable issues were found. Tests were reviewed but not run.
|
nicknisi
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1746.
AutoPaginatable.autoPagination()ignored the page the list method had already fetched and re-requested the list from the start withlimit=100. Everylist…().autoPagination()call therefore cost at least two sequential round trips, even when the first response already held the whole list. This has been the incorrect behavior since auto-pagination was added in #788.autoPagination()now returns the first page as-is when it has noaftercursor, and otherwise continues from that cursor. A single-page list goes from 2 requests to 1; multi-page lists never make more requests than before.generatePagestakes just theaftercursor. Follow-up pages always walk forward from the first page, so thebeforespecial case from fix: drop before cursor on follow-up autoPagination requests #1720 is no longer needed (beforeis still stripped from follow-up requests).pagination.spec.ts,pipes-requests.spec.ts, andfeature-flags.spec.tscases that asserted the redundant re-fetch, and added a case for the no-next-page path.